/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package threadreview;

import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author c0909h1334
 */
public class threadDemoReview
{
    public static void main(String[] a)
    {
        Thread1 t1 = new Thread1();
        

        Runnable1 r1= new Runnable1();
        Thread t2 = new Thread(r1);
        t1.start();
        t2.start();
    }
}
class Thread1 extends Thread
{

    @Override
    public void run() {
        //super.run();
        //int i;
        for(int i=1; i<=5; i++)
        {
            //System.out.println("  *  ");
            //print " "
            for(int j=1; j<=5-i; j++)
            {
                System.out.print(" ");

            }
            
            //int max = 2*i-1;

            for(int j=1; j<=2*i-1; j++)
            {
                System.out.print("*");
            }
            System.out.print("\n");
            try {
                Thread.sleep(1000);
            } catch (InterruptedException ex) {

            }
        }

    }

}

class Runnable1 implements Runnable
{

    public void run()
    {
        for(int i=1;i<=5;i++)
        {
            try
                {
                    System.out.println(i*i);
                    Thread.sleep(1000);
                }catch(InterruptedException ex)
                {
                    Logger.getLogger(Runnable1.class.getName()).log(Level.SEVERE, null,ex);
                }
        }

    }

}